/*
 * geometrybuffer.h
 *
 *  Created on: Jan 12, 2011
 *      Author: dima
 */

#ifndef GEOMETRYBUFFER_H_
#define GEOMETRYBUFFER_H_

#include "prerequisites.h"

#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>

#include "material.h"

#define BUFFERTYPE_P 0

struct Vertex_P
{
  float pos[3];
};


struct GeometryBuffer
{
  int vertexCount;
  int indexCount;
  GLuint vbos[2];
  int primitiveType;
};

GeometryBuffer* createGeometryBuffer(int vertexCount, int vertexStride,
		const void* vertexData, int indexCount, const void* indexData,
		int primitiveType, GLenum bufferType);
void destroyGeometryBuffer(GeometryBuffer * buffer);
void drawGeometryBuffer_P(GeometryBuffer* buffer,Material* mat);


#endif /* GEOMETRYBUFFER_H_ */
